<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>办公室：添加事件</title>
	<jsp:include page="/com/common/_js.jsp"></jsp:include>
	<style>
	.field .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
	</style>
	<script>
	$(function() {
		$("#outTime").datepicker({
			changeMonth: true,
			changeYear: true
		});
		
		$("#outTime").datepicker({
			changeMonth: true,
			changeYear: true
		});
		
			$( "#guideName" ).autocomplete({
				source: function( request, response ) {
					$.ajax({
						url: "com/guideAction!getGuidenameList.jspa",
						dataType: "jsonp",
						data: {
							featureClass: "P",
							style: "full",
							pageSize: 12,
							name: request.term
						},
						success: function( data ) {
							response( $.map( data.namelist, function( item ) {
								return {
									label: item.guideName,
									value: item.guideName,
									guideId: item.guideId
								}
							}));
						}
					});
				},
				minLength: 1,
				select: function( event, ui ) {
					alert(ui.item.guideId);
					$("#guideId").val(ui.item.guideId);
				}
			});
		
	});
	</script>
</head>
<body>
	<div id="web">
		<div id="head"></div>
		<div id="body">
			<div class="container-fluid">
			    <div class="row-fluid">
				    <div class="span2">
				    <jsp:include page="_left.jsp"></jsp:include>
				    </div>
				    <div class="span10">
						   <s:form action="incidentAction!insertIncident.jspa" namespace="/officer">
							<s:hidden id="guideId" name="guideId"></s:hidden>
							<div class="field">
								<label class="label" for="guideNname">导游领队</label>
								<input type="text" id="guideName" name="guideName">
							</div>
							<div class="field">
								<label class="label" for="incidentType">事件类型</label>
								<s:select name="incidentType" list="{'事假','休假','停团',
								'证件更换','其他'}"></s:select>
							</div>
							<div class="field">
								<label class="label" for="inTime">开始时间</label>
								<input type="text" id="inTime" name="inTime" class="datepicker">
							</div>
							<div class="field">
								<label class="label" for="outTime">结束时间</label>
								<input type="text" id="outTime" name="outTime"  class="datepicker">
							</div>
							<div class="field">
								<label class="label" for="matter">备注</label>
								<textarea id="matter" name="matter"></textarea>
							</div>
							<div class="button"><s:submit value="提交"></s:submit></div>
						</s:form>
						
				    </div>
			    </div>
			</div>
		</div>
		<div id="foot"></div>
	</div>

</body>
</html>